package com.itheima.service;

import com.github.pagehelper.Page;
import com.itheima.domain.Book;
import com.itheima.domain.User;
import com.itheima.entity.PageResult;

public interface BookService {
    /*
     * 新书推荐5本
     * */
    PageResult selectNewBooks(int pageNum, int pageSize);

    //根据id查询图书信息
    Book findById(String id);

    // 借阅图书
    Integer borrowBook(Book book);

    PageResult search(Book book, int pageNum, int pageSize);

    Integer addBook(Book book);

    Integer editBook(Book book);

    //查询当前借阅的图书
    PageResult searchBorrowed(Book book, User user, int pageNum, int pageSize);

     //归还图书
     boolean returnBook(String id, User user);

     //归还确认
     boolean returnConfirm(String id);

}